package cn.silver.framework.core.enums;

import cn.silver.framework.core.model.DictModel;
import cn.silver.framework.core.utils.StreamUtils;
import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;

/**
 * @author zhouxiaobo
 */
@Getter
@AllArgsConstructor
public enum SystemStatusEnums {
    /**
     * 正常
     */
    NORMAL("00", "启用"),

    BLOCK("01", "锁定"),
    DISABLED("02", "停用"),
    ;

    private final String code;
    private final String name;

    public static List<DictModel> getModels() {
        return StreamUtils.toList(Arrays.asList(values()), item -> new DictModel(item.name, item.code));
    }
}
